home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / bash1135 / diffs < prev    next >
Text File  |  1994-02-20  |  31KB  |  1,047 lines

  1. diff -u2r orig/builtins/alias.def ./builtins/alias.def
  2. --- orig/builtins/alias.def    Tue Aug 31 22:11:24 1993
  3. +++ ./builtins/alias.def    Fri Feb 11 23:06:16 1994
  4. @@ -58,4 +58,7 @@
  5.        alias_list = all_aliases ();
  6.  
  7. +      if (!alias_list)
  8. +    return (EXECUTION_FAILURE);
  9. +
  10.        for (i = 0; alias_list[i]; i++)
  11.      print_alias (alias_list[i]);
  12. diff -u2r orig/builtins/cd.def ./builtins/cd.def
  13. --- orig/builtins/cd.def    Tue Aug 31 19:52:32 1993
  14. +++ ./builtins/cd.def    Sun Nov 21 21:07:56 1993
  15. @@ -249,12 +249,12 @@
  16.  directory.  With no arguments, exchanges the top two directories.
  17.  
  18. -+n    Rotates the stack so that the Nth directory (counting
  19. -    from the left of the list shown by `dirs') is at the top.
  20. ++n      Rotates the stack so that the Nth directory (counting
  21. +        from the left of the list shown by `dirs') is at the top.
  22.  
  23. --n    Rotates the stack so that the Nth directory (counting
  24. -    from the right) is at the top.
  25. +-n      Rotates the stack so that the Nth directory (counting
  26. +        from the right) is at the top.
  27.  
  28. -dir    adds DIR to the directory stack at the top, making it the
  29. -    new current working directory.
  30. +dir     adds DIR to the directory stack at the top, making it the
  31. +        new current working directory.
  32.  
  33.  You can see the directory stack with the `dirs' command.
  34. @@ -451,11 +451,11 @@
  35.  top directory.
  36.  
  37. -+n    removes the Nth entry counting from the left of the list
  38. -    shown by `dirs', starting with zero.  For example: `popd +0'
  39. -    removes the first directory, `popd +1' the second.
  40. -
  41. --n    removes the Nth entry counting from the right of the list
  42. -    shown by `dirs', starting with zero.  For example: `popd -0'
  43. -    removes the last directory, `popd -1' the next to last.
  44. ++n      removes the Nth entry counting from the left of the list
  45. +        shown by `dirs', starting with zero.  For example: `popd +0'
  46. +        removes the first directory, `popd +1' the second.
  47. +
  48. +-n      removes the Nth entry counting from the right of the list
  49. +        shown by `dirs', starting with zero.  For example: `popd -0'
  50. +        removes the last directory, `popd -1' the next to last.
  51.  
  52.  You can see the directory stack with the `dirs' command.
  53. diff -u2r orig/builtins/echo.def ./builtins/echo.def
  54. --- orig/builtins/echo.def    Tue Aug 31 19:52:32 1993
  55. +++ ./builtins/echo.def    Sun Nov 21 21:02:32 1993
  56. @@ -31,14 +31,14 @@
  57.  suppressed.  If the -e option is given, interpretation of the
  58.  following backslash-escaped characters is turned on:
  59. -    \a    alert (bell)
  60. -    \b    backspace
  61. -    \c    suppress trailing newline
  62. -    \f    form feed
  63. -    \n    new line
  64. -    \r    carriage return
  65. -    \t    horizontal tab
  66. -    \v    vertical tab
  67. -    \\    backslash
  68. -    \num    the character whose ASCII code is NUM (octal).
  69. +        \a      alert (bell)
  70. +        \b      backspace
  71. +        \c      suppress trailing newline
  72. +        \f      form feed
  73. +        \n      new line
  74. +        \r      carriage return
  75. +        \t      horizontal tab
  76. +        \v      vertical tab
  77. +        \\      backslash
  78. +        \num    the character whose ASCII code is NUM (octal).
  79.  
  80.  You can explicitly turn off the interpretation of the above characters
  81. diff -u2r orig/builtins/exec.def ./builtins/exec.def
  82. --- orig/builtins/exec.def    Tue Aug 31 19:52:32 1993
  83. +++ ./builtins/exec.def    Wed Nov 17 23:32:40 1993
  84. @@ -48,4 +48,7 @@
  85.  
  86.  extern char *find_user_command ();
  87. +#ifdef atarist
  88. +extern char *find_suffixed_file ();
  89. +#endif
  90.  
  91.  int
  92. @@ -67,4 +70,5 @@
  93.        /* Otherwise, execve the new command with args. */
  94.        char *command, **args;
  95. +     char *p;
  96.        int dash_name = 0;
  97.  
  98. @@ -85,5 +89,9 @@
  99.       the search path. */
  100.        if (absolute_program (args[0]))
  101. -    command = args[0];
  102. +#ifdef atarist
  103. +    command = find_suffixed_file (args[0]);
  104. +#else
  105. +    command = savestring (args[0]);
  106. +#endif
  107.        else
  108.      command = find_user_command (args[0]);
  109. @@ -95,5 +103,7 @@
  110.      }
  111.  
  112. -      command = full_pathname (command);
  113. +      p = full_pathname (command);
  114. +      free (command);
  115. +      command = p;
  116.        /* If the user wants this to look like a login shell, then
  117.       prepend a `-' onto the first argument (argv[0]). */
  118. diff -u2r orig/builtins/let.def ./builtins/let.def
  119. --- orig/builtins/let.def    Tue Aug 31 19:52:32 1993
  120. +++ ./builtins/let.def    Sun Nov 21 21:02:04 1993
  121. @@ -30,11 +30,11 @@
  122.  The levels are listed in order of decreasing precedence.
  123.  
  124. -    -        unary minus
  125. -    !        logical NOT
  126. -    * / %        multiplication, division, remainder
  127. -    + -        addition, subtraction
  128. -    <= >= < >    comparison
  129. -    == !=        equality inequality
  130. -    =        assignment
  131. +        -               unary minus
  132. +        !               logical NOT
  133. +        * / %           multiplication, division, remainder
  134. +        + -             addition, subtraction
  135. +        <= >= < >       comparison
  136. +        == !=           equality inequality
  137. +        =               assignment
  138.  
  139.  Shell variables are allowed as operands.  The name of the variable
  140. diff -u2r orig/builtins/reserved.def ./builtins/reserved.def
  141. --- orig/builtins/reserved.def    Tue Aug 31 19:52:32 1993
  142. +++ ./builtins/reserved.def    Sun Nov 21 21:01:24 1993
  143. @@ -85,24 +85,24 @@
  144.  BASH_VERSION    The version numbers of this Bash.
  145.  CDPATH          A colon separated list of directories to search
  146. -        when the argument to `cd' is not found in the current
  147. -        directory.
  148. +                when the argument to `cd' is not found in the current
  149. +                directory.
  150.  #if defined (HISTORY)
  151.  HISTFILE        The name of the file where your command history is stored.
  152.  HISTFILESIZE    The maximum number of lines this file can contain.
  153.  HISTSIZE        The maximum number of history lines that a running
  154. -        shell can access.
  155. +                shell can access.
  156.  #endif /* HISTORY */
  157.  HOME            The complete pathname to your login directory.
  158.  HOSTTYPE        The type of CPU and OS this version of Bash is running
  159. -        under.
  160. +                under.
  161.  PATH            A colon separated list of directories to search when
  162. -        looking for commands.
  163. +                looking for commands.
  164.  PROMPT_COMMAND  A command to be executed before the printing of each
  165. -        primary prompt.
  166. +                primary prompt.
  167.  PS1             The primary prompt string.
  168.  TERM            The name of the current terminal type (/etc/termcap).
  169.  auto_resume     Non-null means a command word appearing on a line by
  170. -        itself is first looked for in the list of currently
  171. -        stopped jobs.  If found there, that job is foregrounded.
  172. +                itself is first looked for in the list of currently
  173. +                stopped jobs.  If found there, that job is foregrounded.
  174.  #if defined (HISTORY)
  175.  command_oriented_history
  176. @@ -121,29 +121,29 @@
  177.  #  if defined (BANG_HISTORY)
  178.  histchars       Characters controlling history expansion and quick
  179. -        substitution.  The first character is the history
  180. -        substitution character, usually `!'.  The second is
  181. -        the `quick substition' character, usually `^'.
  182. +                substitution.  The first character is the history
  183. +                substitution character, usually `!'.  The second is
  184. +                the `quick substition' character, usually `^'.
  185.  #  endif /* BANG_HISTORY */
  186.  history_control Set to a value of "ignorespace", it means don't enter
  187. -        lines which begin with a SPC on the history list.  Set
  188. -        to a value of "ignoredups", it means don't enter lines
  189. -        which match the last entered line.  Unset, or any
  190. -        other value than those above mean to save all lines
  191. -        on the history list.
  192. +                lines which begin with a SPC on the history list.  Set
  193. +                to a value of "ignoredups", it means don't enter lines
  194. +                which match the last entered line.  Unset, or any
  195. +                other value than those above mean to save all lines
  196. +                on the history list.
  197.  #endif /* HISTORY */
  198.  hostname_completion_file
  199. -        Contains the name of a file in the same format as
  200. -        `/etc/hosts' that should be read when Bash needs to
  201. -        complete a hostname.
  202. +                Contains the name of a file in the same format as
  203. +                `/etc/hosts' that should be read when Bash needs to
  204. +                complete a hostname.
  205.  ignoreeof       Controls the action of the shell on receipt of an EOF
  206. -        character as the sole input.  If set, then the value
  207. -        of it is the number of EOF characters that can be seen
  208. -        in a row as sole input characters before the shell
  209. -        will exit (default 10).  When unset, EOF signifies the
  210. -        end of input.
  211. +                character as the sole input.  If set, then the value
  212. +                of it is the number of EOF characters that can be seen
  213. +                in a row as sole input characters before the shell
  214. +                will exit (default 10).  When unset, EOF signifies the
  215. +                end of input.
  216.  no_exit_on_failed_exec
  217. -        If this variable exists, the shell will not exit in
  218. -        the case that it couldn't execute the file specified
  219. -        in the `exec' command.
  220. +                If this variable exists, the shell will not exit in
  221. +                the case that it couldn't execute the file specified
  222. +                in the `exec' command.
  223.  #if defined (JOB_CONTROL)
  224.  notify          notify of job termination immediately.
  225. diff -u2r orig/builtins/set.def ./builtins/set.def
  226. --- orig/builtins/set.def    Tue Aug 31 19:52:32 1993
  227. +++ ./builtins/set.def    Sat Nov 20 20:59:28 1993
  228. @@ -63,5 +63,5 @@
  229.              notify       save as -b
  230.              nounset      same as -u
  231. -        privileged   same as -p
  232. +            privileged   same as -p
  233.              verbose      same as -v
  234.  #if defined (READLINE)
  235. @@ -72,5 +72,5 @@
  236.          Disables processing of the $ENV file and importing of shell
  237.          functions.  Turning this option off causes the effective uid and
  238. -    gid to be set to the real uid and gid.
  239. +        gid to be set to the real uid and gid.
  240.      -t  Exit after reading and executing one command.
  241.      -u  Treat unset variables as an error when substituting.
  242. diff -u2r orig/builtins/ulimit.def ./builtins/ulimit.def
  243. --- orig/builtins/ulimit.def    Tue Aug 31 19:52:34 1993
  244. +++ ./builtins/ulimit.def    Sun Nov 21 20:58:36 1993
  245. @@ -29,17 +29,17 @@
  246.  option is given, it is interpreted as follows:
  247.  
  248. -    -S    use the `soft' resource limit
  249. -    -H    use the `hard' resource limit
  250. -    -a    all current limits are reported
  251. -    -c    the maximum size of core files created
  252. -    -d    the maximum size of a process's data segment
  253. -    -m    the maximum resident set size
  254. -    -s    the maximum stack size
  255. -    -t    the maximum amount of cpu time in seconds
  256. -    -f    the maximum size of files created by the shell
  257. -    -p    the pipe buffer size
  258. -    -n    the maximum number of open file descriptors
  259. +    -S  use the `soft' resource limit
  260. +    -H  use the `hard' resource limit
  261. +    -a  all current limits are reported
  262. +    -c  the maximum size of core files created
  263. +    -d  the maximum size of a process's data segment
  264. +    -m  the maximum resident set size
  265. +    -s  the maximum stack size
  266. +    -t  the maximum amount of cpu time in seconds
  267. +    -f  the maximum size of files created by the shell
  268. +    -p  the pipe buffer size
  269. +    -n  the maximum number of open file descriptors
  270.      -u  the maximum number of user processes
  271. -    -v    the size of virtual memory 
  272. +    -v  the size of virtual memory 
  273.  
  274.  If LIMIT is given, it is the new value of the specified resource.
  275. diff -u2r orig/config.h ./config.h
  276. --- orig/config.h    Tue Aug 31 19:52:34 1993
  277. +++ ./config.h    Sat Dec 18 16:04:40 1993
  278. @@ -127,5 +127,5 @@
  279.     Posix compliant behaviour by setting the environment variable
  280.     POSIXLY_CORRECT. */
  281. -#define ALLOW_RIGID_POSIX_COMPLIANCE
  282. +/* #define ALLOW_RIGID_POSIX_COMPLIANCE */
  283.  
  284.  /* Define RESTRICTED_SHELL if you want the generated shell to have the
  285. @@ -133,5 +133,5 @@
  286.     restricted by being run with the name "rbash", or by setting the -r
  287.     flag. */
  288. -#define RESTRICTED_SHELL
  289. +/* #define RESTRICTED_SHELL */
  290.  
  291.  /* Define DISABLED_BUILTINS if you want "builtin foo" to always run the
  292. @@ -143,5 +143,5 @@
  293.  /* Right now, you cannot do this on machines without fully operational
  294.     FIFO support.  This currently include NeXT and Alliant. */
  295. -#if !defined (MKFIFO_MISSING)
  296. +#if !defined (MKFIFO_MISSING) || defined (HAVE_DEV_FD)
  297.  #  define PROCESS_SUBSTITUTION
  298.  #endif /* !MKFIFO_MISSING */
  299. diff -u2r orig/execute_cmd.c ./execute_cmd.c
  300. --- orig/execute_cmd.c    Fri Nov 12 16:55:40 1993
  301. +++ ./execute_cmd.c    Tue Dec 28 14:07:08 1993
  302. @@ -432,4 +432,7 @@
  303.      {
  304.        close_pipes (pipe_in, pipe_out);
  305. +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
  306. +      unlink_fifo_list ();
  307. +#endif /* PROCESS_SUBSTITUTION && HAVE_DEV_FD */
  308.  
  309.        /* If we are part of a pipeline, and not the end of the pipeline,
  310. @@ -1428,4 +1431,7 @@
  311.          {
  312.            close_pipes (pipe_in, pipe_out);
  313. +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
  314. +          unlink_fifo_list ();
  315. +#endif /* PROCESS_SUBSTITUTION && HAVE_DEV_FD */
  316.            goto return_result;
  317.          }
  318. @@ -1468,4 +1474,7 @@
  319.      {
  320.        close_pipes (pipe_in, pipe_out);
  321. +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
  322. +      unlink_fifo_list ();
  323. +#endif /* PROCESS_SUBSTITUTION && HAVE_DEV_FD */
  324.        result = EXECUTION_SUCCESS;
  325.        goto return_result;
  326. @@ -1783,7 +1792,46 @@
  327.      }
  328.  
  329. +  /* Clear any ouput errors from redirected builtins.  */
  330. +  clearerr (stdout);
  331. +  clearerr (stderr);
  332. +
  333.    return (result);
  334.  }
  335.  
  336. +#if defined (atarist)
  337. +static char *const suffixes[] = { ".ttp", ".tos", ".prg", ".app", ".gtp" };
  338. +
  339. +#define N_SUFFIXES (sizeof (suffixes) / sizeof (suffixes[0]))
  340. +#define MAX_SUFFIX_LEN 4
  341. +
  342. +char *
  343. +find_suffixed_file (name)
  344. +     char *name;
  345. +{
  346. +  char *basename = strrchr (name, '/');
  347. +
  348. +  if (strchr (basename ? basename : name, '.') == NULL)
  349. +    {
  350. +      int i, status, name_len = strlen (name);
  351. +      char *name_suffix = alloca (name_len + MAX_SUFFIX_LEN + 1);
  352. +
  353. +      status = file_status (name);
  354. +      if (status & FS_EXISTS)
  355. +    return savestring (name);
  356. +
  357. +      strcpy (name_suffix, name);
  358. +      for (i = 0; i < N_SUFFIXES; i++)
  359. +    {
  360. +      strcpy (name_suffix + name_len, suffixes[i]);
  361. +      status = file_status (name_suffix);
  362. +
  363. +      if (status & FS_EXECABLE)
  364. +        return savestring (name_suffix);
  365. +    }
  366. +    }
  367. +  return savestring (name);
  368. +}
  369. +#endif
  370. +
  371.  /* Execute a simple command that is hopefully defined in a disk file
  372.     somewhere.
  373. @@ -1866,5 +1914,9 @@
  374.        /* A command containing a slash is not looked up in PATH. */
  375.        if (absolute_program (words->word->word))
  376. +#ifdef atarist
  377. +    command = find_suffixed_file (words->word->word);
  378. +#else
  379.      command = savestring (words->word->word);
  380. +#endif
  381.        else
  382.      {
  383. @@ -1955,4 +2007,7 @@
  384.        /* Make sure that the pipes are closed in the parent. */
  385.        close_pipes (pipe_in, pipe_out);
  386. +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
  387. +      unlink_fifo_list ();
  388. +#endif /* PROCESS_SUBSTITUTION && HAVE_DEV_FD */
  389.        if (command)
  390.      free (command);
  391. @@ -2035,4 +2090,12 @@
  392.    args[larry] = (char *)NULL;
  393.  
  394. +#ifdef atarist
  395. +  {
  396. +    char *p = find_suffixed_file (execname);
  397. +    free (execname);
  398. +    execname = p;
  399. +  }
  400. +#endif
  401. +
  402.    return (shell_execve (execname, args, env));
  403.  }
  404. @@ -3148,5 +3211,9 @@
  405.    if (absolute_program (name))
  406.      {
  407. +#ifdef atarist
  408. +      full_path = (char *)xmalloc (1 + MAX_SUFFIX_LEN + name_len);
  409. +#else
  410.        full_path = (char *)xmalloc (1 + name_len);
  411. +#endif
  412.        strcpy (full_path, name);
  413.  
  414. @@ -3156,4 +3223,21 @@
  415.        if (!(status & FS_EXISTS))
  416.      {
  417. +#ifdef atarist
  418. +      char *basename = strrchr (name, '/');
  419. +      if (strchr (basename ? basename : name, '.') == NULL)
  420. +        {
  421. +          int i;
  422. +
  423. +          for (i = 1; i < N_SUFFIXES; i++)
  424. +        {
  425. +          strcpy (full_path + name_len, suffixes[i]);
  426. +          status = file_status (full_path);
  427. +
  428. +          if (flags & FS_EXEC_ONLY
  429. +              ? status & FS_EXECABLE : status & FS_EXISTS)
  430. +            return full_path;
  431. +        }
  432. +        }
  433. +#endif
  434.        free (full_path);
  435.        return ((char *)NULL);
  436. @@ -3203,5 +3287,9 @@
  437.      dot_found_in_search = 1;
  438.  
  439. +#ifdef atarist
  440. +      full_path = make_full_pathname (path, name, name_len + MAX_SUFFIX_LEN);
  441. +#else
  442.        full_path = make_full_pathname (path, name, name_len);
  443. +#endif
  444.        free (path);
  445.  
  446. @@ -3209,5 +3297,38 @@
  447.  
  448.        if (!(status & FS_EXISTS))
  449. +#ifndef atarist
  450.      goto next_file;
  451. +#else
  452. +    {
  453. +      if (strchr (name, '.') == NULL)
  454. +        {
  455. +          int i, len = strlen (full_path);
  456. +
  457. +          for (i = 0; i < N_SUFFIXES; i++)
  458. +        {
  459. +          strcpy (full_path + len, suffixes[i]);
  460. +          status = file_status (full_path);
  461. +          if (status & FS_EXISTS)
  462. +            {
  463. +              if (flags & FS_EXISTS)
  464. +            return full_path;
  465. +              if (status & FS_EXECABLE)
  466. +            {
  467. +              if (file_to_lose_on)
  468. +                free (file_to_lose_on);
  469. +
  470. +              return full_path;
  471. +            }
  472. +              if (flags & FS_EXEC_PREFERRED)
  473. +            {
  474. +              if (!file_to_lose_on)
  475. +                file_to_lose_on = savestring (full_path);
  476. +            }
  477. +            }
  478. +        }
  479. +        }
  480. +      goto next_file;
  481. +    }
  482. +#endif
  483.  
  484.        /* The file exists.  If the caller simply wants the first file,
  485. diff -u2r orig/general.c ./general.c
  486. --- orig/general.c    Tue Aug 31 19:53:44 1993
  487. +++ ./general.c    Thu Dec 16 19:33:48 1993
  488. @@ -559,4 +559,9 @@
  489.    char *result;
  490.    
  491. +#ifdef atarist
  492. +  if (string[0] && string[1] == ':')
  493. +    return (savestring (string));
  494. +#endif
  495. +
  496.    if (!dot_path || *string == '/')
  497.      result = savestring (string);
  498. @@ -593,4 +598,9 @@
  499.      return (1);
  500.  
  501. +#ifdef atarist
  502. +  if (string[0] && string[1] == ':')
  503. +    return 1;
  504. +#endif
  505. +
  506.    if (*string++ == '.')
  507.      {
  508. @@ -650,4 +660,8 @@
  509.      if (*file == '/')
  510.        return (file);
  511. +#ifdef atarist
  512. +    else if (*file && file[1] == ':')
  513. +      return file;
  514. +#endif
  515.  
  516.    disposer = file;
  517. @@ -688,4 +702,6 @@
  518.  }
  519.  
  520. +#ifndef atarist
  521. +
  522.  #if !defined (to_upper)
  523.  #define lowercase_p(c) (((c) > ('a' - 1) && (c) < ('z' + 1)))
  524. @@ -733,4 +749,6 @@
  525.    return (*string1 | *string2);
  526.  }
  527. +
  528. +#endif /* !atarist */
  529.  
  530.  /* Set the environment variables $LINES and $COLUMNS in response to
  531. diff -u2r orig/jobs.c ./jobs.c
  532. --- orig/jobs.c    Thu Dec 16 18:18:54 1993
  533. +++ ./jobs.c    Thu Dec 16 18:54:18 1993
  534. @@ -190,5 +190,7 @@
  535.  /* These are definitions to map POSIX 1003.1 functions onto existing BSD
  536.     library functions and system calls. */
  537. +#ifndef atarist
  538.  #define setpgid(pid, pgrp)    setpgrp (pid, pgrp)
  539. +#endif
  540.  #define tcsetpgrp(fd, pgrp)    ioctl ((fd), TIOCSPGRP, &(pgrp))
  541.  
  542. @@ -205,4 +207,5 @@
  543.  }
  544.  
  545. +#ifndef atarist
  546.  /* Perform OPERATION on NEWSET, perhaps leaving information in OLDSET. */
  547.  sigprocmask (operation, newset, oldset)
  548. @@ -233,4 +236,5 @@
  549.      *oldset = old;
  550.  }
  551. +#endif /* !atarist */
  552.  #endif /* !_POSIX_VERSION */
  553.  
  554. @@ -1908,5 +1912,5 @@
  555.      wait3 ((union wait *)statusp, options, (struct rusage *)0)
  556.  #else
  557. -#  if defined (_POSIX_VERSION)
  558. +#  if defined (_POSIX_VERSION) || defined (atarist)
  559.  #    define WAITPID(pid, statusp, options) \
  560.      waitpid ((pid_t)pid, statusp, options)
  561. @@ -2237,5 +2241,5 @@
  562.  /* getpgrp () varies between systems.  Even systems that claim to be
  563.     Posix.1 compatible lie sometimes (Ultrix, SunOS4, apollo). */
  564. -#if defined (_POSIX_VERSION) && !defined (BSD_GETPGRP)
  565. +#if defined (_POSIX_VERSION) && !defined (BSD_GETPGRP) || defined (atarist)
  566.  #  define getpgid(p) getpgrp ()
  567.  #else
  568. diff -u2r orig/jobs.h ./jobs.h
  569. --- orig/jobs.h    Thu Dec 16 18:18:54 1993
  570. +++ ./jobs.h    Thu Dec 16 18:55:28 1993
  571. @@ -214,5 +214,5 @@
  572.  #endif /* !SIGCHLD */
  573.  
  574. -#if !defined (_POSIX_VERSION)
  575. +#if !defined (_POSIX_VERSION) && !defined (atarist)
  576.  #  if !defined (SIG_BLOCK)
  577.  #    define SIG_BLOCK 2
  578. @@ -251,5 +251,5 @@
  579.    sigprocmask (SIG_BLOCK, &nvar, &ovar)
  580.  
  581. -#if defined (_POSIX_VERSION)
  582. +#if defined (_POSIX_VERSION) || defined (atarist)
  583.  #  define BLOCK_CHILD(nvar, ovar) \
  584.      BLOCK_SIGNAL (SIGCHLD, nvar, ovar)
  585. diff -u2r orig/lib/readline/bind.c ./lib/readline/bind.c
  586. --- orig/lib/readline/bind.c    Fri Nov 12 16:55:38 1993
  587. +++ ./lib/readline/bind.c    Thu Dec 16 19:34:32 1993
  588. @@ -66,4 +66,5 @@
  589.  extern int rl_blink_matching_paren;
  590.  extern int _rl_convert_meta_chars_to_ascii;
  591. +extern int _rl_output_meta_chars;
  592.  #if defined (VISIBLE_STATS)
  593.  extern int rl_visible_stats;
  594. @@ -82,5 +83,7 @@
  595.  
  596.  static int glean_key_from_name ();
  597. +#ifndef atarist
  598.  static int stricmp (), strnicmp ();
  599. +#endif
  600.  
  601.  #if defined (STATIC_MALLOC)
  602. @@ -934,4 +937,5 @@
  603.    { "blink-matching-paren",    &rl_blink_matching_paren },
  604.    { "convert-meta",        &_rl_convert_meta_chars_to_ascii },
  605. +  { "output-meta",        &_rl_output_meta_chars },
  606.  #if defined (VISIBLE_STATS)
  607.    { "visible-stats",        &rl_visible_stats },
  608. @@ -1364,4 +1368,5 @@
  609.  }
  610.  
  611. +#ifndef atarist
  612.  /* Whoops, Unix doesn't have strnicmp. */
  613.  
  614. @@ -1402,4 +1407,6 @@
  615.    return (*string1 | *string2);
  616.  }
  617. +
  618. +#endif /* !atarist */
  619.  
  620.  /* Determine if s2 occurs in s1.  If so, return a pointer to the
  621. diff -u2r orig/lib/readline/complete.c ./lib/readline/complete.c
  622. --- orig/lib/readline/complete.c    Thu Dec 16 18:18:46 1993
  623. +++ ./lib/readline/complete.c    Sat Jan 29 19:58:14 1994
  624. @@ -137,5 +137,5 @@
  625.  
  626.  /* Local variable states what happened during the last completion attempt. */
  627. -static int completion_changed_buffer = 0;
  628. +static int completion_was_ambigous = 0;
  629.  
  630.  /* Complete the word at or before point.  You have supplied the function
  631. @@ -146,5 +146,5 @@
  632.       int ignore, invoking_key;
  633.  {
  634. -  if (rl_last_func == rl_complete && !completion_changed_buffer)
  635. +  if (rl_last_func == rl_complete && completion_was_ambigous)
  636.      rl_complete_internal ('?');
  637.    else
  638. @@ -277,16 +277,11 @@
  639.    Function *our_func;
  640.    int start, scan, end, delimiter = 0, pass_next;
  641. -  char *text, *saved_line_buffer;
  642. +  char *text;
  643.    char *replacement;
  644. -#if defined (SHELL)
  645.    char quote_char = '\0';
  646. +#if defined (SHELL)
  647.    int found_quote = 0;
  648.  #endif
  649.  
  650. -  if (rl_line_buffer)
  651. -    saved_line_buffer = savestring (rl_line_buffer);
  652. -  else
  653. -    saved_line_buffer = (char *)NULL;
  654. -
  655.    if (rl_completion_entry_function)
  656.      our_func = rl_completion_entry_function;
  657. @@ -468,21 +463,16 @@
  658.           Copy all the non-dead entries into a new array. */
  659.        {
  660. -        char **temp_array =
  661. -          (char **)xmalloc ((3 + newlen) * sizeof (char *));
  662. -
  663.          for (i = 1, j = 1; matches[i]; i++)
  664.            {
  665.          if (matches[i] != (char *)&dead_slot)
  666. -          temp_array[j++] = matches[i];
  667. +          matches[j++] = matches[i];
  668.            }
  669.  
  670. -        temp_array[j] = (char *)NULL;
  671. +        matches[j] = (char *)NULL;
  672.  
  673.          if (matches[0] != (char *)&dead_slot)
  674.            free (matches[0]);
  675.  
  676. -        free (matches);
  677. -
  678. -        matches = temp_array;
  679. +        matches = realloc (matches, (j + 1) * sizeof (char *));
  680.        }
  681.  
  682. @@ -578,4 +568,5 @@
  683.          }
  684.  
  685. +      rl_begin_undo_group ();
  686.        if (replacement)
  687.          {
  688. @@ -630,4 +621,5 @@
  689.          }
  690.          }
  691. +      rl_end_undo_group ();
  692.        break;
  693.  
  694. @@ -636,7 +628,7 @@
  695.          int i = 1;
  696.  
  697. +        rl_begin_undo_group ();
  698.          rl_delete_text (start, rl_point);
  699.          rl_point = start;
  700. -        rl_begin_undo_group ();
  701.          if (matches[1])
  702.            {
  703. @@ -823,18 +815,9 @@
  704.      }
  705.  
  706. +      completion_was_ambigous = matches[1] != NULL;
  707. +
  708.        for (i = 0; matches[i]; i++)
  709.      free (matches[i]);
  710.        free (matches);
  711. -    }
  712. -
  713. -  /* Check to see if the line has changed through all of this manipulation. */
  714. -  if (saved_line_buffer)
  715. -    {
  716. -      if (strcmp (rl_line_buffer, saved_line_buffer) != 0)
  717. -    completion_changed_buffer = 1;
  718. -      else
  719. -    completion_changed_buffer = 0;
  720. -
  721. -      free (saved_line_buffer);
  722.      }
  723.  }
  724. diff -u2r orig/lib/readline/display.c ./lib/readline/display.c
  725. --- orig/lib/readline/display.c    Wed Sep  1 22:25:04 1993
  726. +++ ./lib/readline/display.c    Sat Nov 20 18:37:40 1993
  727. @@ -59,5 +59,5 @@
  728.  extern void _rl_output_character_function ();
  729.  
  730. -extern int _rl_convert_meta_chars_to_ascii;
  731. +extern int _rl_output_meta_chars;
  732.  extern int _rl_horizontal_scroll_mode;
  733.  extern int _rl_mark_modified_lines;
  734. @@ -219,5 +219,5 @@
  735.        if (META_CHAR (c))
  736.      {
  737. -      if (_rl_convert_meta_chars_to_ascii)
  738. +      if (!_rl_output_meta_chars)
  739.          {
  740.            sprintf (line + out, "\\%o", c);
  741. @@ -602,5 +602,5 @@
  742.       int c;
  743.  {
  744. -  if (META_CHAR (c) && _rl_convert_meta_chars_to_ascii)
  745. +  if (META_CHAR (c) && !_rl_output_meta_chars)
  746.      {
  747.        fprintf (rl_outstream, "M-");
  748. @@ -626,5 +626,5 @@
  749.  {
  750.    if (META_CHAR (c))
  751. -    return (_rl_convert_meta_chars_to_ascii ? 4 : 1);
  752. +    return (!_rl_output_meta_chars ? 4 : 1);
  753.  
  754.    if (c == '\t')
  755. diff -u2r orig/lib/readline/isearch.c ./lib/readline/isearch.c
  756. --- orig/lib/readline/isearch.c    Tue Aug 31 19:53:50 1993
  757. +++ ./lib/readline/isearch.c    Sat Nov 20 14:32:30 1993
  758. @@ -323,4 +323,7 @@
  759.            ding ();
  760.            i = last_found_line;
  761. +          index = rl_point;
  762. +          if (c >= 32 && c <= 126)
  763. +        search_string[--search_string_index] = '\0';
  764.            break;
  765.  
  766. diff -u2r orig/lib/readline/readline.c ./lib/readline/readline.c
  767. --- orig/lib/readline/readline.c    Fri Nov 12 16:55:52 1993
  768. +++ ./lib/readline/readline.c    Sat Nov 20 18:33:18 1993
  769. @@ -236,4 +236,8 @@
  770.  int _rl_convert_meta_chars_to_ascii = 1;
  771.  
  772. +/* Non-zero means to output characters with the meta bit set directly
  773. +   instead of as escape sequence. */
  774. +int _rl_output_meta_chars = 0;
  775. +
  776.  /* Non-zero tells rl_delete_text and rl_insert_text to not add to
  777.     the undo list. */
  778. @@ -517,6 +521,8 @@
  779.  
  780.        fcntl (tty, F_SETFL, flags);
  781. +#ifndef atarist
  782.        if (chars_avail == -1 && errno == EAGAIN)
  783.      return;
  784. +#endif
  785.      }
  786.  #endif /* O_NDELAY */
  787. @@ -1544,5 +1550,5 @@
  788.      {
  789.        /* If possible and desirable, concatenate the undos. */
  790. -      if ((strlen (string) == 1) &&
  791. +      if (l == 1 &&
  792.        rl_undo_list &&
  793.        (rl_undo_list->what == UNDO_INSERT) &&
  794. @@ -1626,20 +1632,22 @@
  795.    if (count < 0)
  796.      rl_backward (-count);
  797. -  else
  798. -    while (count)
  799. -      {
  800. +  else if (count > 0)
  801. +    {
  802.  #if defined (VI_MODE)
  803. -    if (rl_point >= (rl_end - (rl_editing_mode == vi_mode)))
  804. +      if (rl_point + count > (rl_end - (rl_editing_mode == vi_mode)))
  805.  #else
  806. -    if (rl_point == rl_end)
  807. +      if (rl_point + count > rl_end)
  808.  #endif /* VI_MODE */
  809. -      {
  810. -        ding ();
  811. -        return 0;
  812. -      }
  813. -    else
  814. -      rl_point++;
  815. -    --count;
  816. -      }
  817. +    {
  818. +#if defined (VI_MODE)
  819. +      rl_point = (rl_end - (rl_editing_mode == vi_mode));
  820. +#else
  821. +      rl_point = rl_end;
  822. +#endif /* VI_MODE */
  823. +      ding ();
  824. +    }
  825. +      else
  826. +    rl_point += count;
  827. +    }
  828.    return 0;
  829.  }
  830. @@ -1651,16 +1659,14 @@
  831.    if (count < 0)
  832.      rl_forward (-count);
  833. -  else
  834. -    while (count)
  835. -      {
  836. -    if (!rl_point)
  837. -      {
  838. -        ding ();
  839. -        return 0;
  840. -      }
  841. -    else
  842. -      --rl_point;
  843. -    --count;
  844. -      }
  845. +  else if (count > 0)
  846. +    {
  847. +      if (rl_point < count)
  848. +    {
  849. +      rl_point = 0;
  850. +      ding ();
  851. +    }
  852. +      else
  853. +    rl_point -= count;
  854. +    }
  855.    return 0;
  856.  }
  857. @@ -2116,5 +2122,5 @@
  858.      rl_point--;
  859.  
  860. -      rl_kill_text (rl_point, orig_point);
  861. +      rl_kill_text (orig_point, rl_point);
  862.      }
  863.    return 0;
  864. diff -u2r orig/machines.h ./machines.h
  865. --- orig/machines.h    Thu Dec 16 18:18:58 1993
  866. +++ ./machines.h    Thu Dec 30 14:45:12 1993
  867. @@ -1630,4 +1630,29 @@
  868.  #endif /* cadmus */
  869.  
  870. +/* ************************ */
  871. +/*                */
  872. +/*    Atari ST        */
  873. +/*                */
  874. +/* ************************ */
  875. +#if defined (atarist)
  876. +#define M_MACHINE "atarist"
  877. +#define M_OS "MiNT"
  878. +#define HAVE_POSIX_SIGNALS
  879. +#define HAVE_VFPRINTF
  880. +#define HAVE_SETLINEBUF
  881. +#define HAVE_STRCHR
  882. +#define HAVE_STRERROR
  883. +#define HAVE_GETGROUPS
  884. +#define HAVE_DUP2
  885. +#define HAVE_GETPAGESIZE
  886. +#define HAVE_GETDTABLESIZE
  887. +#define HAVE_GETWD
  888. +#define HAVE_SYS_SIGLIST
  889. +#define SYSDEP_CFLAGS -DHAVE_BCOPY -DHAVE_UID_T -DMKFIFO_MISSING
  890. +#undef USE_GNU_MALLOC
  891. +#define HAVE_DIRENT
  892. +#define VOID_SIGHANDLER
  893. +#endif
  894. +
  895.  /* **************************************************************** */
  896.  /*                                    */
  897. diff -u2r orig/maxpath.h ./maxpath.h
  898. --- orig/maxpath.h    Fri Nov 12 16:54:58 1993
  899. +++ ./maxpath.h    Sat Nov 20 13:46:08 1993
  900. @@ -11,5 +11,5 @@
  901.  
  902.  #if !defined (MAXPATHLEN)
  903. -#  if defined (bsdi) || defined (OSF1) || defined (Solaris) || defined (Dynix)
  904. +#  if defined (bsdi) || defined (OSF1) || defined (Solaris) || defined (Dynix) || defined (atarist)
  905.  #    include <sys/param.h>
  906.  #  endif /* bsdi || OSF1 || Solaris || Dynix */
  907. diff -u2r orig/nojobs.c ./nojobs.c
  908. --- orig/nojobs.c    Thu Dec 16 18:19:08 1993
  909. +++ ./nojobs.c    Thu Dec 16 19:01:42 1993
  910. @@ -57,9 +57,9 @@
  911.  #endif /* USG || _POSIX_VERSION */
  912.  
  913. -#if defined (USG)
  914. +#if defined (USG) || defined (atarist)
  915.  #  define siginterrupt(sig, code)
  916.  #endif /* USG */
  917.  
  918. -#if defined (_POSIX_VERSION)
  919. +#if defined (_POSIX_VERSION) || defined (atarist)
  920.  #  define WAITPID(pid, statusp, options) waitpid (pid, statusp, options)
  921.  #else
  922. diff -u2r orig/parse.y ./parse.y
  923. --- orig/parse.y    Thu Dec 16 18:19:10 1993
  924. +++ ./parse.y    Sun Feb 20 16:03:26 1994
  925. @@ -50,5 +50,4 @@
  926.  #endif /* PROMPT_STRING_DECODE */
  927.  
  928. -#define YYDEBUG 1
  929.  extern int eof_encountered;
  930.  extern int no_line_editing;
  931. @@ -2069,5 +2068,7 @@
  932.        {
  933.  #if defined (PROCESS_SUBSTITUTION)
  934. -        if (character == '$' || character == '<' || character == '>')
  935. +        if (character == '$'
  936. +        || ((character == '<' || character == '>')
  937. +            && current_delimiter () != '"'))
  938.  #else
  939.          if (character == '$')
  940. @@ -2490,5 +2491,5 @@
  941.        register int i;
  942.  
  943. -      chars_to_add = (char *)NULL;
  944. +      chars_to_add = "; ";
  945.  
  946.        for (i = 0; no_semi_successors[i]; i++)
  947. @@ -2500,6 +2501,4 @@
  948.          }
  949.          }
  950. -      if (!chars_to_add)
  951. -        chars_to_add = "; ";
  952.      }
  953.        else
  954. diff -u2r orig/shell.c ./shell.c
  955. --- orig/shell.c    Thu Dec 16 18:19:14 1993
  956. +++ ./shell.c    Sun Feb 20 16:05:18 1994
  957. @@ -360,6 +360,4 @@
  958.    }
  959.  
  960. -  yydebug = 0;
  961. -
  962.    shell_environment = env;
  963.    shell_name = argv[0];
  964. @@ -529,5 +527,7 @@
  965.      }
  966.  
  967. +#ifndef atarist
  968.  #define CLOSE_FDS_AT_LOGIN
  969. +#endif
  970.  
  971.  #if defined (CLOSE_FDS_AT_LOGIN)
  972. @@ -1021,4 +1021,10 @@
  973.            history_lines_this_session = 0;
  974.          }
  975. +      else
  976. +        {
  977. +          result = write_history (hf);
  978. +          history_lines_in_file = history_lines_this_session;
  979. +          history_lines_this_session = 0;
  980. +        }
  981.      }
  982.      }
  983. @@ -1944,7 +1950,9 @@
  984.  }
  985.  
  986. +#ifndef atarist
  987.  #if !defined (USG) && defined (ENOTSOCK)
  988.  #include <sys/socket.h>
  989.  #endif
  990. +#endif
  991.  
  992.  /* Is FD a socket or network connection? */
  993. @@ -1953,4 +1961,7 @@
  994.       int fd;
  995.  {
  996. +#ifdef atarist
  997. +  return 0;
  998. +#else
  999.  #if defined (USGr4) || defined (USGr4_2)
  1000.    /* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */
  1001. @@ -1983,3 +1994,4 @@
  1002.  #  endif /* !ENOTSOCK && !USG */
  1003.  #endif /* !USGr4 && !USGr4_2 */
  1004. +#endif /* !atarist */
  1005.  }
  1006. diff -u2r orig/subst.c ./subst.c
  1007. --- orig/subst.c    Thu Dec 16 18:19:20 1993
  1008. +++ ./subst.c    Sun Feb 20 16:06:22 1994
  1009. @@ -1769,4 +1769,9 @@
  1010.      pid_t old_pipeline_pgrp = pipeline_pgrp;
  1011.      pipeline_pgrp = shell_pgrp;
  1012. +#ifdef atarist
  1013. +    /* Avoid race condition.  Since fork () is blocking, we don't have
  1014. +       the chance to set the SIGCHLD handler before the child dies.  */
  1015. +    set_sigchld_handler ();
  1016. +#endif
  1017.      pid = make_child (savestring ("process substitution"), 1);
  1018.      if (pid == 0)
  1019. @@ -1897,4 +1902,9 @@
  1020.  
  1021.      pipeline_pgrp = shell_pgrp;
  1022. +#ifdef atarist
  1023. +    /* Avoid race condition.  Since fork () is blocking, we don't have
  1024. +       the chance to set the SIGCHLD handler before the child dies.  */
  1025. +    set_sigchld_handler ();
  1026. +#endif
  1027.      pid = make_child (savestring ("command substitution"), 0);
  1028.      if (pid == 0)
  1029. @@ -2436,4 +2446,7 @@
  1030.          char *temp1;
  1031.          int old_index;
  1032. +
  1033. +        if (quoted)
  1034. +          goto add_character;
  1035.  
  1036.          if (string[++sindex] != '(')
  1037. diff -u2r orig/trap.c ./trap.c
  1038. --- orig/trap.c    Fri Nov 12 16:56:02 1993
  1039. +++ ./trap.c    Sat Nov 20 14:44:54 1993
  1040. @@ -111,5 +111,5 @@
  1041.       int signal;
  1042.  {
  1043. -  if (signal > NSIG)
  1044. +  if (signal >= NSIG)
  1045.      return ("bad signal number");
  1046.    else
  1047.